package com.oig.auth.api.factory;

import com.oig.auth.api.PermissionService;
import com.oig.auth.api.fallback.PermissionServiceFallbackImpl;
import org.springframework.cloud.openfeign.FallbackFactory;
import org.springframework.stereotype.Component;

@Component
public class PermissionFallbackFactory implements FallbackFactory<PermissionService> {

    @Override
    public PermissionService create(Throwable cause) {
        PermissionServiceFallbackImpl permissionServiceFallback = new PermissionServiceFallbackImpl();
        permissionServiceFallback.setCause(cause);
        return permissionServiceFallback;
    }
}
